#include "dbq_geterrorbyid.h"


namespace mysqlquery
{


dbq_geterrorbyid::dbq_geterrorbyid()
{
  setErrorID(0);
}

dbq_geterrorbyid::dbq_geterrorbyid(long errorid)
{
  setErrorID(errorid);
}

dbq_geterrorbyid::~dbq_geterrorbyid()
{
}

QSqlQuery dbq_geterrorbyid::getSqlQuery()
{
  QString query = QString("SELECT error_code.*, module.module_name "
                          "FROM error_code, module "
                          " WHERE error_code.module_id = module.module_id");

  query += " and error_code.error_id = " + QString::number(error_id);
  return QSqlQuery(query);
}

void dbq_geterrorbyid::setErrorID(long id)
{
  error_id = id;
}

int dbq_geterrorbyid::getErrorID()
{
  return error_id;
}

} //mysqlquery


